using System;
using System.Collections.Generic;
using System.Linq;

namespace CodeDom
{
  /// <summary>
  /// 
  /// </summary>
  internal class TemplateEqualityComparer : IEqualityComparer<Template>
  {
    #region IEqualityComparer<Template> Members

    /// <summary>
    /// Determines whether the specified objects are equal.
    /// </summary>
    /// <param name="x">The first object of type <paramref name="x"/> to compare.</param>
    /// <param name="y">The second object of type <paramref name="y"/> to compare.</param>
    /// <returns>
    /// true if the specified objects are equal; otherwise, false.
    /// </returns>
    public bool Equals(Template x, Template y)
    {
      return x.ID == y.ID;
    }

    /// <summary>
    /// Returns a hash code for the specified object.
    /// </summary>
    /// <param name="obj">The <see cref="T:System.Object"/> for which a hash code is to be returned.</param>
    /// <returns>A hash code for the specified object.</returns>
    /// <exception cref="T:System.ArgumentNullException">
    /// The type of <paramref name="obj"/> is a reference type and <paramref name="obj"/> is null.
    /// </exception>
    public int GetHashCode(Template obj)
    {
      return obj.ID.GetHashCode();
    }

    #endregion
  }
}